package com.modai.springcloud.controller;

import com.modai.springcloud.Service.AccountService;
import com.modai.springcloud.entities.CommonResult;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author ：modai
 * @date ：Created in 2020-12-21 12:07
 * @description：
 */
@RestController
public class AccountController {
    @Resource
    private AccountService accountService;



    @PostMapping("/account/decrease")
    public CommonResult decrease(Long userId,BigDecimal money){
        accountService.decrease(userId,money);
        return new CommonResult(200,"扣减余额成功。");
    }
}
